﻿
using HBase;
using System;
using System.Collections.Generic;

namespace hCommand {
    public class MoveScheduleTask :ZtTask {

        List<Node> nodeList;

        public override bool excute() {
            if( nodeList == null ) {
                nodeList = MyCache.getList<Node>();
            }
        

            foreach( Node node in nodeList ) {
                Estimate me = node.getCurrent();
                if( me != null ) {

                    Estimate next = me.getNextEstimate();
                    while (next != null) {
                        DateTime dt = me.getMoveNext();
                        Node nextNode = next.getNode();
                        DateTime begin = nextNode.getFreeTime(dt, next);
                        next.setBegin(begin);
                        me.setEndDate(begin);
                        me = next;
                        next = next.getNextEstimate();
                    }
                    
                  
                }
                node.statStop();
            }


            return true;
        }




    }
}
